﻿using static System.Console;

/*
 * Task And Await
 */

Task task = Task.Run(() => ThreadMethod());
task.Wait();
WriteLine("主线程继续执行");

ReadLine();

void ThreadMethod()
{
    WriteLine("线程开始执行");
    // 执行一些任务
    Thread.Sleep(2000);
    WriteLine("线程结束执行");
}